using UnityEngine;
using System.Collections;

public class Instructions : Reaction {
	
	bool firstEat = true;

	protected override void pain (float amount)
	{
		if(firstEat)
		{
			firstEat = false;
			StartCoroutine(fade());
		}
	}
	
	IEnumerator fade()
	{
		Color color = renderer.material.color;
		float time = 1, fadeTime = 0;
		while(fadeTime < time)
		{
			color.a = Mathf.Lerp(1, 0, fadeTime/time);
			renderer.material.SetColor("_Color", color);
			yield return 0;
			fadeTime += Time.deltaTime;
		}
	}
}
